package com.imti.controller;

import com.imti.bean.Registration;
import com.imti.bean.UserInfo;
import com.imti.service.RegistrationService;
import com.imti.util.PageBean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/registration")
public class RegistrationController {

    @Resource
    private RegistrationService registrationService;

    @RequestMapping("/page")
    public String pageRegistrationInfo(Registration registration, PageBean page, HttpServletRequest request) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("registration", registration);
        map.put("page", page);
        PageBean p = registrationService.pageRegistrationInfo(map);
        request.setAttribute("page", p);
        return "/registration-list";
    }
    @RequestMapping("/selectCard")
    public String registrationselectCard(Registration registration, PageBean page, HttpServletRequest request) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("registration", registration);
        map.put("page", page);
        PageBean p = registrationService.pageRegistrationInfo(map);
        request.setAttribute("page", p);
        return "/card-message";
    }
}
